﻿namespace KingerRobot.MexicoSailunWMS.SpiService;
internal interface IRcsEquip
{
    /// <summary>
    /// 获取所有设备网络状态
    /// </summary>
    /// <returns></returns>
    List<POWcsEquipStatus> GetAllEquipStatues();
    /// <summary>
    /// 根据设备名称获取设备
    /// </summary>
    /// <param name="name">设备名称</param>
    /// <returns></returns>
    PORcsEquip GetRcsEquipByName(string name);
    /// <summary>
    /// 获取所有启用设备
    /// </summary>
    /// <returns></returns>
    List<PORcsEquip> GetEquips();
    /// <summary>
    /// 获取所有设备
    /// </summary>
    /// <returns></returns>
    List<PORcsEquip> GetAllEquips();
    /// <summary>
    ///获取指定 设备 
    /// </summary>
    /// <param name="ids"></param>
    /// <returns></returns>
    List<PORcsEquip> GetRcsEquipByIds(List<long?> ids);
    /// <summary>
    /// 通过ID查找设备
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    PORcsEquip GetRcsEquipById(long? id);
    /// <summary>
    /// 获取所有异常设备
    /// </summary>
    /// <returns></returns>
    List<PORcsEquip> GetAbnormalEquipAll();
    /// <summary>
    /// 通过ID查找正常设备
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    PORcsEquip GetWorkEquipById(long? id);
    /// <summary>
    /// 通过ID查找设备是否异常(true 可用；false 不可用)
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    bool IsEnableEquipById(long? id);

    /// <summary>
    /// 通过Code查找设备
    /// </summary>
    /// <param name="equipCode"></param>
    /// <returns></returns>
    PORcsEquip GetRcsEquipByCode(string equipCode);
    /// <summary>
    ///获取指定类型设备 
    /// </summary>
    /// <param name="types"></param>
    /// <returns></returns>
    List<PORcsEquip> GetRcsEquipByType(List<long?> types);
    /// <summary>
    /// 修改设备可用
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    int UpdateEquipEnable(long id);
    /// <summary>
    /// 通过ids修改设备可用 指定设备可用状态
    /// </summary>
    /// <param name="ids">设备ids</param>
    /// <param name="enable">指定设备可用状态</param>
    /// <returns></returns>
    int UpdateEquipEnableByIds(List<long?> ids, int enable);
    /// <summary>
    /// EMS硫化排B车禁用时，当前取胎口经过虚拟扫描任务指令删除，任务变更为异常任务，删除指令硫化机重新请料
    /// </summary>
    /// <param name="pORcsEquip"></param>
    /// <returns></returns>
    bool UpdateEmsWhenTrouble(PORcsEquip pORcsEquip);
}